﻿<%@ WebHandler Language="C#" Class="AccountListAshx" %>

using System;
using System.Web;
using System.Collections.Generic;

public class AccountListAshx : IHttpHandler
{
    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        List<UserData> list = new UserProxy().SelectAllUser();
        string result = "[";
        for (int i = 0; i < list.Count; i++)
        {
            result += list[i].toJson();
            if (i < list.Count - 1)
                result += ",";
        }
        result += "]";
        context.Response.Write(Message.CreateMessage(true, result));
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}